<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<!-- Extracts the SQL transaction queries from SQL Server 2005 Profiler XML trace file. -->
    <!-- Author: David Luu -->
    <!-- Last updated: 02/02/2009 -->
    <!-- Version 0.1, alpha status, not working as expected. -->
    <!-- Not well documented. Use at your own risk. -->
    <!-- I could use some help with fine tuning the stylesheet to get it working the way it should. -->
    <xsl:output method="text"/>
    <xsl:strip-space elements="*"/>
    <xsl:variable name="newline" select="'&#10;'" />
    <xsl:param name="newlineY"><xsl:text>
	</xsl:text></xsl:param>
    <xsl:template match="TraceData">
	    <xsl:apply-templates select="Events//Event"/>
    </xsl:template>
    <xsl:template match="Event">
	    My bad...
        <xsl:for-each select="//Column[@name = 'TextData']">
        	<xsl:value-of select="."/>
		    <xsl:value-of select="$newline"/>
		    <xsl:value-of select="$newline"/>
	    </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>